#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(void){
    int t;
    ll a,b,k;
    scanf("%d",&t);
    while(t--){
        scanf("%I64d%I64d%I64d",&a,&b,&k);
        ll num=k/2;
        ll re=k%2;
        ll unit=a-b;
        ll ans=(num*unit)+re*a;
        printf("%I64d\n",ans); 
    }
    return 0;
}